CLS
INPUT "vvedite razmer pervogo massiva"; n: m = 5
DIM a(n), b(m)
PRINT STRING$(80, 196); "vvedite elementy pervogo massiva"
FOR i = 1 TO n
PRINT "vvedite element #"; i;
INPUT a(i)
NEXT
PRINT STRING$(80, 196); "vvedite 5 elementov vtorogo massiva"
FOR i = 1 TO m
PRINT "vvedite element #"; i;
INPUT b(i)
NEXT
PRINT STRING$(80, 196); "soobsheniya:"
FOR j = 1 TO m: f = 0: FOR i = 1 TO n
IF b(j) = a(i) THEN f = 1
NEXT
IF f = 0 THEN PRINT "element iz massiva 2 pod #"; j; "ne vstretilsa v massive 1"
NEXT
PRINT "bolshe soobshenij netu..."
FOR i = 1 TO n: FOR j = 1 TO m
IF a(i) = b(j) AND i <= n - k THEN
FOR i1 = i + 1 TO n
SWAP a(i1 - 1), a(i1)
NEXT: k = k + 1: END IF
NEXT: NEXT
PRINT STRING$(80, 196); "rezultat:"
FOR i = 1 TO n - k
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )